# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libexif

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.6.21
pkgrel=2
pkgdesc="A library to parse an EXIF file and read the data from those tags (mingw-w64)"
arch=('any')
url="http://sourceforge.net/projects/libexif"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gettext")
options=(!libtool strip)
source=("http://downloads.sf.net/sourceforge/libexif/libexif-${pkgver}.tar.bz2")
md5sums=('27339b89850f28c8f1c237f233e05b27')

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ${srcdir}/${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --disable-docs \
    --enable-shared \
    --disable-static
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
  find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
}
